import { instance } from '@/utils/request';

const getGoodType = () => {
  return instance.get('/Goods/GetGoodType');
};

const getGoodTypeCount = (sid?: number) => {
  return instance.get('/Goods/GetGoodTypeCount', { sid });
};

const getGoodHot = (page: number, limit: number) => {
  return instance.get(`/Goods/GetGoodHot`, { page, limit });
};

const getGoodPromote = (page: number, limit: number) => {
  return instance.get(`/Goods/GetGoodPromote`, { page, limit });
};

const getGoodPagnation = (page: number, limit: number, gtid?: number, key?: string) => {
  return instance.get(`/Goods/GetGoodPagnation`, { page, limit, gtid, key });
};

const getGoodPagnation2 = (
  page: number,
  limit: number,
  key?: string,
  sid?: number,
  gtid?: number,
  isShelve?: number
) => {
  return instance.get(`/Goods/Pagination`, { page, limit, gtid, key, sid, isShelve });
};

const getGoodDetail = (id: number) => {
  return instance.get(`/Goods/GetGoodDetail`, { id });
};

export default {
  getGoodType,
  getGoodHot,
  getGoodPromote,
  getGoodPagnation,
  getGoodDetail,
  getGoodTypeCount,
  getGoodPagnation2,
}; // 导出 default
